#include <stdio.h>
main () {
    int c, lastc;
    while ((c = getchar()) != EOF) {
        if (c == ' ' || c == '\t') {
            if (lastc != ' ' && lastc != '\t') {
                putchar('\n');
            }
        } else {
            putchar(c);
        }
        lastc = c;
    }
}